home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Trial / Camtasia 6 / camtasia.msi / Cabs.w1.cab / getVidInfo.swf / scripts / frame_1 / DoAction.as
Text File  |  2008-10-09  |  935b  |  35 lines

  1. function getVidInfo(filename)
  2. {
  3.    var _loc1_ = {};
  4.    _loc1_.nc = new NetConnection();
  5.    _loc1_.nc.connect(null);
  6.    _loc1_.ns = new NetStream(_loc1_.nc);
  7.    _loc1_.filename = filename;
  8.    _loc1_.ns.onMetaData = mx.utils.Delegate.create(_loc1_,onMeta);
  9.    _loc1_.ns.onStatus = mx.utils.Delegate.create(_loc1_,onStatus);
  10.    _loc1_.ns.play(filename);
  11.    return filename;
  12. }
  13. function copyObj(rhs)
  14. {
  15.    var _loc2_ = {};
  16.    for(var _loc3_ in rhs)
  17.    {
  18.       _loc2_[_loc3_] = typeof rhs[_loc3_] != "object" ? rhs[_loc3_] : "??";
  19.    }
  20.    return _loc2_;
  21. }
  22. function onMeta(meta)
  23. {
  24.    flash.external.ExternalInterface.call("onVidInfo",this.filename,copyObj(meta));
  25.    this.ns.close();
  26. }
  27. function onStatus(info)
  28. {
  29.    if(info.level == "error")
  30.    {
  31.       flash.external.ExternalInterface.call("onVidInfo",this.filename,"error");
  32.    }
  33. }
  34. flash.external.ExternalInterface.addCallback("getVidInfo",null,getVidInfo);
  35.